﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DXApplicationTangche.DTO;
using DevExpress.XtraGrid.Demos.util;
using mendian;

namespace DXApplicationTangche.UC.物料管理
{
    public partial class Frm物料分类新增 : DevExpress.XtraEditors.XtraForm
    {
        public string parentId;
        public Frm物料分类新增(string parentId)
        {
            InitializeComponent();
            this.parentId = parentId;
            this.comboBox基础类.SelectedIndex = 0;
        }

        private void simpleButton保存_Click(object sender, EventArgs e)
        {
            String json = FunctionHelper.JsonSerialization(new DTO物料分类(this.parentId, true, this.textEdit1.Text, this.comboBox基础类.SelectedIndex == 0?false:true));
            String str = RestCall.PostHttp(URL.接口url + "/material/saveMaterialCatelog", json);
            MessageBox.Show("保存成功");
            this.Close();
        }
    }
}